<template>
  <div>
    <van-cell :title="'对评论点赞'"></van-cell>
    <van-cell v-for="(item, idx) in list" :key="idx">
      <span style="color: #466b9d;" slot="title">{{ item.aut_name }}</span>
      <div slot="label">
        <p style="color: #363636;">{{ item.content }}</p>
        <p>
          <span style="margin-right: 10px;">{{ item.pubdate }}</span>
        </p>
      </div>
      <van-icon
        slot="right-icon"
        :name="item.is_liking ? 'like' : 'like-o'"
        @click="hSwitchLike(item)"
      />
    </van-cell>
  </div>
</template>

<script>
export default {
  data() {
    return {
      list: [
        {
          aut_name: "李林森",
          content: "言辞犀利有内涵",
          pubdate: "2002",
          is_liking: false
        },
        {
          aut_name: "李林森2",
          content: "言辞犀利有内涵",
          pubdate: "2002",
          is_liking: false
        }
      ]
    };
  },
  methods: {
    hSwitchLike(item) {
      item.is_liking = !item.is_liking;
    }
  }
};
</script>
